package coupon

import (
	"context"

	"mall/app/coupon/cmd/api/internal/svc"
	"mall/app/coupon/cmd/api/internal/types"

	"github.com/zeromicro/go-zero/core/logx"
)

type DeleteSeckillSessionLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

func NewDeleteSeckillSessionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSeckillSessionLogic {
	return &DeleteSeckillSessionLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *DeleteSeckillSessionLogic) DeleteSeckillSession(req *types.DeleteSeckillSessionReq) error {
	err := l.svcCtx.SeckillSessionModel.Delete(l.ctx, req.Id)
	if err != nil {
		l.Error(err)
	}
	return nil
}
